CC := g++
CFLAGS := -c -O3
LDFLAGS := -s -pipe
FILES := main Approach ApproachSearcher AsteroidOrbitParam DEEphem ephcom EphemDE EphemEPM EphemWrapper Integrator LeapFrogIntegrator OrbitElemTransform rada RadaWrapper SimpleFile Trajectory
EXECUTABLE := test

#EXT_INCLUDE := "C:\bin\MinGW\lib\gcc\mingw32\4.5.0\include\c++" "C:\bin\MinGW\include" 
EXT_INCLUDE := "C:\bin\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include\c++" "C:\bin\cygwin\usr\include"

ROOT_DIR := ../../
SUBDIR := . Common Ephemerides/Common
MY_INCLUDE_PATHS := $(addprefix $(ROOT_DIR), $(SUBDIR))
VPATH := $(addprefix $(ROOT_DIR), $(SUBDIR))
FULL_INCLUDE_PATH := . $(MY_INCLUDE_PATHS) $(EXT_INCLUDE) 

SRC_FILE := $(addsuffix .cpp, $(FILES))
OBJECTS := $(addsuffix .o, $(FILES) ) 

all: $(EXECUTABLE)
	
$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
	$(CC) $(CFLAGS) $(addprefix -I, $(FULL_INCLUDE_PATH)) $< -o $@ 
	
clean:
	del *.o 
	del *.d